import Mock from 'mockjs'
import type { ICategory } from '@/types/category'

const colors = ['#409EFF', '#67C23A', '#E6A23C', '#F56C6C', '#909399']

const categoryList: ICategory[] = Mock.mock({
  'list|12': [{
    
    'id|+1': 1,
    'color': () => colors[Math.floor(Math.random() * colors.length)],
    'name': '@ctitle(3, 6)',
    'description': '@csentence(10, 20)',
    'questionCount|10-50': 1,
    'createTime': '@date("yyyy-MM-dd")',
    'status|1': [0, 1]
  }]
})
Mock.mock(/\/category\/list/, 'post', ()=>{return categoryList})
Mock.mock(/\/category\/delete/, 'deletes', ()=>{return categoryList})

